package com.example.controller;

import com.example.common.response.ServerResponse;
import com.example.dto.DemoDTO;
import com.example.dto.TypechoCommentsDTO;
import com.example.dto.base.PageDTO;
import com.example.entity.TypechoComments;
import com.example.service.TypechoCommentsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Auther: Swain
 * @Date: 2021/1/22 14:03
 * @Version 1.0.0
 */
@Api(tags = "文章评论请求控制器")
@Validated
@RestController
@RequestMapping(value = "/comments")
public class TypechoCommentsController {

    @Autowired
    private TypechoCommentsService typechoCommentsService;

    @PostMapping("/find/list/page")
    @ApiOperation(value = "分页查询列表", notes = "分页查询列表")
    public ServerResponse findListPage(@RequestBody @Validated(PageDTO.findListPage.class) TypechoCommentsDTO typechoCommentsDTO) {
        return typechoCommentsService.findListPage(typechoCommentsDTO);
    }

}
